<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>查看员工</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<div class="container">
  <header class="header">
    <h1>员工管理系统</h1>
    <div class="user-info">
      欢迎, ${loggedInUser.username}!
      <a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">返回列表</a>
      <a href="${pageContext.request.contextPath}/logout" class="btn btn-secondary">退出登录</a>
    </div>
  </header>

  <main class="main-content">
    <h2>员工详情</h2>

    <div class="employee-details">
      <div class="detail-item">
        <label>ID:</label>
        <span>${employee.id}</span>
      </div>
      <div class="detail-item">
        <label>姓名:</label>
        <span>${employee.name}</span>
      </div>
      <div class="detail-item">
        <label>部门:</label>
        <span>${employee.department}</span>
      </div>
      <div class="detail-item">
        <label>职位:</label>
        <span>${employee.position}</span>
      </div>
      <div class="detail-item">
        <label>薪资:</label>
        <span>${employee.salary}</span>
      </div>
      <div class="detail-item">
        <label>邮箱:</label>
        <span>${employee.email}</span>
      </div>
      <div class="detail-item">
        <label>电话:</label>
        <span>${employee.phone}</span>
      </div>
      <div class="detail-item">
        <label>入职日期:</label>
        <span>${employee.hireDate}</span>
      </div>
      <div class="detail-item">
        <label>创建人:</label>
        <span>${employee.createdByName}</span>
      </div>
      <div class="detail-item">
        <label>创建时间:</label>
        <span>${employee.createdAt}</span>
      </div>
    </div>

    <div class="form-actions">
      <a href="${pageContext.request.contextPath}/employees?action=edit&id=${employee.id}"
         class="btn btn-warning">编辑</a>
      <a href="${pageContext.request.contextPath}/employees" class="btn btn-secondary">返回</a>
    </div>
  </main>
</div>
</body>
</html>